home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
CRESC
/
Lengths
/
length-repeat
< prev
next >
Wrap
Lisp/Scheme
|
1996-12-31
|
851b
|
25 lines
length-repeat div-number pattern &optional length
This is a note-length equivalent to symbol-repeat. It divides the note length values with <div-number> and adds the appropriate number of extra note-lengths to equal the original note-length.
(setq rhy '(1/4 1/16 1/8 1/16))
(setq var1 (length-repeat 2 rhy))
--> (1/8 1/8 1/32 1/32 1/16 1/16 1/32 1/32)
(setq var2 (length-repeat 4 rhy))
--> (1/16 1/16 1/16 1/16 1/64 1/64 1/64 1/64 1/32 1/32 1/32
1/32 1/64 1/64 1/64 1/64)
If the optional length is supplied then it is identified and processed and other lengths remain untouched.
(setq rhy '(1/4 1/16 1/8 1/16))
(setq var1 (length-repeat 4 rhy '1/8))
--> (1/4 1/16 1/32 1/32 1/32 1/32 1/16)
Try this function nested several times:
(setq var2 (length-repeat 2 (length-repeat 4 rhy '1/8) '1/4))
--> (1/8 1/8 1/16 1/32 1/32 1/32 1/32 1/16)